<?php

/**
 * @Description    控制器代码
 * @Author         admin
 * @Copyright      山东艾思软件科技有限公司(https://www.aisisofit.cn)
 * @Date           2022-07-09 14:10:06
 * @CreateBy       Curd System
 */

namespace app\web\controller;

class NewsController extends \app\common\controller\CommonController {
    protected $model = null;
    protected $validate = null;

    // 初始化
    public function initialize() {
        parent::initialize();

        $this->model = new \app\web\model\WebNews();
        $this->validate = new \app\web\validate\WebNews();
    }

    public function lists() {
        $keyword = input('keyword', '');

        $where = [];
        if ($keyword != '') $where[] = ['title|desc', 'like', "%$keyword%"];

        $list = $this->model->getPageList($where);

        json_return(1, '获取成功', $list);
    }
}
